<layout name="master"/>
<div class="btn-group" style="margin: 20px 0px">
    <a href="{:U('addrules')}" class="btn btn-success">添加规则</a>
</div>
<table class="table table-hover">
    <thead>
    <tr>
        <th>编号</th>
        <th>规则名字</th>
        <th>规则标识</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <foreach name="rules" item="vo">
        <tr>
            <td>{$vo['id']}</td>
            <td>{$vo['name']}</td>
            <td>{$vo['title']}</td>
            <td>
                <div class="btn-group">
                    <a href="{:U('addrules',['id'=>$vo['id']])}" class="btn btn-info">编辑</a>
                    <a href="javascript:;" onclick="del({$vo['id']})" class="btn btn-danger">删除</a>
                </div>
            </td>
        </tr>
    </foreach>
    </tbody>
</table>
<script>
    function del(id) {
        require(['util'], function (util) {
            util.confirm('确定删除吗?', function () {
                location.href = "__ROOT__/index.php/admin/rule/delrule/id/" + id;
            });
        })
    }

</script>